﻿<UserControl x:Class="CncConvProg.View.Lavorazioni.Foratura.Pattern.DrillingPatternSelectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ValueConverter="clr-namespace:CncConvProg.View.ValueConverter" 
             xmlns:Foratura="clr-namespace:CncConvProg.Model.ConversationalStructure.Lavorazioni.Foratura;assembly=CncConvProg.Model" xmlns:Resources="clr-namespace:MecPrev.Resources;assembly=MecPrev.Resources" mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="600">
    <UserControl.Resources>
        <ValueConverter:EnumToBoolConverter x:Key="EBConverter"/>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height=".8*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width=".5*" />
            <ColumnDefinition Width=".5*" />
        </Grid.ColumnDefinitions>
        <ListBox x:Name="RadioButtonList" BorderThickness="0" Background="{x:Null}" Grid.RowSpan="1">
            <ListBox.ItemContainerStyle>
                <Style TargetType="{x:Type ListBoxItem}">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                <ContentPresenter/>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListBox.ItemContainerStyle>
            <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton1, Mode=OneWay}">
                <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.Circolare}}" Content="{x:Static Resources:EditWorkRes.Circle}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton1"     
                        />
            </ListBoxItem>
            <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton3, Mode=OneWay}">
                <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.Rettangolare}}" Content="{x:Static Resources:EditWorkRes.Rectangle}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton3" 
                    />
            </ListBoxItem>
            <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton4, Mode=OneWay}">
                <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.Arco}}" Content="{x:Static Resources:EditWorkRes.Arc}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton4" 
                    />
            </ListBoxItem>
            <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton5, Mode=OneWay}">
                <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.Linea}}" Content="{x:Static Resources:EditWorkRes.Line}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton5" 
                    />
            </ListBoxItem>
            <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton6, Mode=OneWay}">
                <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.CoordinateXy}}" Content="{x:Static Resources:EditWorkRes.CoordinateXY}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton6" 
                    />
            </ListBoxItem>
            <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton2, Mode=OneWay}">
                <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.CoordinateRc}}" Content="{x:Static Resources:EditWorkRes.CoordinateRadiusAngle}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton2" 
                    />
            </ListBoxItem>

        </ListBox>

        <Image Grid.Column="1" Source="{Binding SelectedItem.Content.Tag, ElementName=RadioButtonList}" Grid.RowSpan="2" />

        <GroupBox Header="{x:Static Resources:EditWorkRes.PatternParameter}" Grid.Row="1" Grid.ColumnSpan="2">
            <ContentControl Content="{Binding Path=PatternParameter}"/>
        </GroupBox>

    </Grid>
</UserControl>
